<template>
	<view>
		<headerView ref="headerView"></headerView>
		<view class="mainContent">
			<view class="mainView_content_left_empty" />

			<view class="mainCenter">
				<mainleft ref="mainleft"></mainleft>
				<userInfo ref="userInfo" v-show="is_userInfo_show"></userInfo>
				<addcpView style="width: 1000px;" ref="addcpView" v-show="is_addcpView_show"></addcpView>
				<addQdView style="width: 1000px;" ref="addQdView" v-show="is_addqdView_show"></addQdView>
				<addTieziView style="width: 1000px;" ref="addTieziView" v-show="is_addtzView_show"></addTieziView>

				<showCpView style="width: 1000px;" ref="showCpView" v-show="is_showcpView_show"></showCpView>
				<myqdView style="width: 1000px;" ref="myqdView" v-show="is_showqdView_show"></myqdView>
				<mytiezi style="width: 1000px;" ref="mytiezi" v-show="is_showMyTz_show"></mytiezi>
				<my_hf style="width: 1000px;" ref="my_hf" v-show="is_showMyHf_show"></my_hf>
				<my_revice_hf style="width: 1000px;" ref="my_revice_hf" v-show="is_show_my_revice_hf"></my_revice_hf>
			</view>
			<view class=".mainView_content_right_empty" />

		</view>


	</view>
</template>

<script>
	import headerView from '../header/Headerview'
	import footerView from '../footer/Footer'
	import mainleft from "./mainleft"
	import userInfo from "./userInfo"
	import addcpView from '../chanping/addcpView'
	import addQdView from '../qd/addQdView'
	import addTieziView from '../luntan/addTieziView'
	import showCpView from './user_my_cp_list'
	import myqdView from './my_qd'
	import mytiezi from './my_tiezi'
	import my_hf from './my_hf'
	import my_revice_hf from './my_revice_hf'
	export default {
		components: {
			headerView,
			footerView,
			mainleft,
			userInfo,
			addcpView,
			addQdView,
			addTieziView,
			showCpView,
			myqdView,
			my_hf,
			mytiezi,
			my_revice_hf,

		},
		data() {
			return {
				is_userInfo_show: true,
				is_addcpView_show: false,
				is_addqdView_show: false,
				is_addtzView_show: false,
				is_showcpView_show: false,
				is_showqdView_show: false,
				is_showMyTz_show: false,
				is_showMyHf_show: false,
				is_show_my_revice_hf: false,

			}
		},
		created() {
			uni.$on('itemClick', (res) => {
				this.changeMainView(res);
			})

		},
		methods: {
			changeMainView(index) {
				console.log("changeMainView", index);
				if (index == 0) {
					this.is_userInfo_show = true;
					this.is_addcpView_show = false;
					this.is_addqdView_show = false;
					this.is_addtzView_show = false;
					this.is_showcpView_show = false;
					this.is_showqdView_show = false;
					this.is_showMyHf_show = false;
					this.is_showMyTz_show = false;
					this.is_show_my_revice_hf = false;
				} else if (index == 1) {
					this.is_addcpView_show = true;
					this.is_userInfo_show = false;
					this.is_addqdView_show = false;
					this.is_addtzView_show = false;
					this.is_showcpView_show = false;
					this.is_showqdView_show = false;
					this.is_showMyHf_show = false;
					this.is_showMyTz_show = false;
					this.is_show_my_revice_hf = false;

				} else if (index == 2) {
					this.is_addqdView_show = true;
					this.is_addcpView_show = false;
					this.is_userInfo_show = false;
					this.is_addtzView_show = false;
					this.is_showcpView_show = false;
					this.is_showqdView_show = false;
					this.is_showMyHf_show = false;
					this.is_showMyTz_show = false;
					this.is_show_my_revice_hf = false;
				} else if (index == 3) {
					this.is_addtzView_show = true;
					this.is_addqdView_show = false;
					this.is_addcpView_show = false;
					this.is_userInfo_show = false;
					this.is_showcpView_show = false;
					this.is_showqdView_show = false;
					this.is_showMyHf_show = false;
					this.is_showMyTz_show = false;
					this.is_show_my_revice_hf = false;
				} else if (index == 4) {
					this.is_addtzView_show = false;
					this.is_addqdView_show = false;
					this.is_addcpView_show = false;
					this.is_userInfo_show = false;
					this.is_showcpView_show = true;
					this.is_showqdView_show = false;
					this.is_showMyHf_show = false;
					this.is_showMyTz_show = false;
					this.is_show_my_revice_hf = false;
					this.$refs.showCpView.getChanPing(1);
				} else if (index == 5) {
					this.is_addtzView_show = false;
					this.is_addqdView_show = false;
					this.is_addcpView_show = false;
					this.is_userInfo_show = false;
					this.is_showcpView_show = false;
					this.is_showqdView_show = true;
					this.is_showMyHf_show = false;
					this.is_showMyTz_show = false;
					this.is_show_my_revice_hf = false;
					this.$refs.myqdView.getqd(1);
				} else if (index == 6) {
					this.is_addtzView_show = false;
					this.is_addqdView_show = false;
					this.is_addcpView_show = false;
					this.is_userInfo_show = false;
					this.is_showcpView_show = false;
					this.is_showqdView_show = false;
					this.is_showMyHf_show = false;
					this.is_showMyTz_show = true;
					this.is_show_my_revice_hf = false;
					this.$refs.mytiezi.getMyTz(1);
				} else if (index == 7) {
					this.is_addtzView_show = false;
					this.is_addqdView_show = false;
					this.is_addcpView_show = false;
					this.is_userInfo_show = false;
					this.is_showcpView_show = false;
					this.is_showqdView_show = false;
					this.is_show_my_revice_hf = false;
					this.is_showMyTz_show = false;
					this.is_showMyHf_show = true;
					this.$refs.my_hf.getMyHf(1);
				} else if (index == 8) {
					this.is_show_my_revice_hf = true;
					this.is_addtzView_show = false;
					this.is_addqdView_show = false;
					this.is_addcpView_show = false;
					this.is_userInfo_show = false;
					this.is_showcpView_show = false;
					this.is_showqdView_show = false;
					this.is_showMyTz_show = false;
					this.is_showMyHf_show = false;
					this.$refs.my_revice_hf.getReviceHf(1);

				}
			}
		}
	}
</script>

<style>
	.mainContent {
		padding-top: 70px;
		display: flex;
		flex-direction: row;
	}

	.mainView_content_left_empty {
		display: flex;
		height: auto;
		width: 21.5rem;
		background: #f1f2f3;
	}

	.mainView_content_left_empty {
		display: flex;
		height: auto;
		width: 21.5rem;
		background: #f1f2f3;
	}

	/* 右边内容 */
	.mainView_content_right_empty {
		width: 21.25rem;
		flex-direction: column;
		display: flex;
		height: auto;
		background: #f1f2f3;
	}

	.mainCenter {
		display: flex;
		flex-direction: row;
	}
</style>
